<?php
ob_start();
if(isset($_SERVER['HTTP_APPVERSION'])){
include "../saesiteinfo.php";
 }else{
include "../siteinfo.php";
}
//连接数据库
$localhost=mysql_connect($sqlhost,$sqluser,$sqlpass)or die("无法连接服务器");
mysql_select_db($sqldata,$localhost);
include "./header.php";
if (isset($_COOKIE["SHANIUUSER"]) && isset($_COOKIE["SHANIUPASS"])){
$user=$_COOKIE["SHANIUUSER"];
$pass=$_COOKIE["SHANIUPASS"];
//用户数据
$mysql = mysql_query("SELECT * FROM user WHERE user='$user'");
$sql= mysql_fetch_array($mysql);
//判断登录否
/*
if ($sql['pass']!=$pass){
header("Location:../index.php");
}
*/
//查询QQ个数
$qqnumsql="SELECT COUNT(id) FROM qqlist WHERE myqq='$user' ";
$qqnumqqlist = mysql_fetch_array( mysql_query($qqnumsql) );
$qqnum=$qqnumqqlist[0];
mysql_query("UPDATE user SET qqnum='$qqnum' WHERE user='$user'");
?>
<script src="/js/jquery-1.8.0.min.js" type="text/javascript" ></script>
<link rel="stylesheet" type="text/css" href="/css/register.css"/>
<script type="text/javascript" src="../zDrag.js"></script>
<script type="text/javascript" src="../zDialog.js"></script>
<body>
<div class='signup_container'>
    <h1 class='signup_title'><?php echo $sitename; ?>-用户中心</h1>
            <form name="form" method="post" action="../delete.php">   
        <div class="body">
            
            
            
            <div class="content">
                
                

                <div class="row-fluid">
                    <div class="span12">
                        <div class="block">
                            <div class="head blue">
                                <h2>账户:<font color=red><strong><?php echo $sql['user'];?></strong></font> | 注册日期:<?php echo $sql['regdate'];?><br />剩余挂Q配额：您共有<font color=red><strong><?php echo $qqnum; ?></strong></font>/<font color=red><strong><?php echo $chushi+$sql['peie'];?></strong></font>个！
								<br/><br/><a class="button" href="javascript:open13()">添加QQ记录</a> | <a href="javascript:form.submit();" class="button dblue">删除QQ号<a/> | <a href="../center.php" class="button green">扩充挂Q配额</a> | <a href="../logout.php" class="button green">退出</a>
								</h2>
								<br/>
                                <ul class="buttons">
                                    <li><a href="#" onClick="source('table_sort'); return false;"></a></li>
                                </ul>
                            </div>                
                                <div class="data-fluid">
                                    <table class="table dtable lcnp" cellpadding="0" cellspacing="0" width="100%">
                                        <thead>
                                            <tr>
                                                <th><input type="checkbox" class="checkall" name="checkName" onClick="funCheck(this)"></th>
                                                <th width="20%">服务器</th>
                                                <th width="25%">QQ状态</th>
                                                <th width="25%">QQ号码</th>
                                                <th width="30%">设置</th>
                                            </tr>
                                        </thead>
                                        <tbody>
 <?php
$qqlistsql=mysql_query("SELECT * FROM  qqlist WHERE  myqq='$user' ORDER BY  id ASC ");
while($qqlist = mysql_fetch_array($qqlistsql))
  {
  //服务器变量
  $fwq=$qqlist['fwq'];
  $fw['fw1']="<strong><font color=red>①号</font></strong>";
  $fw['fw2']="<strong><font color=#FF00FF>②号</font></strong>";
  $fw['fw3']="<strong><font color=#0000FF>③号</font></strong>";
  $fw['fw4']="<strong><font color=#006400>④号</font></strong>";
  $fw['fw5']="<strong><font color=#00BFFF>⑤号</font></strong>";
  $fw['fw6']="<strong><font color=#8A2BE2>⑥号</font></strong>";
  $fw['fw7']="<strong><font color=#CC0066>⑦号</font></strong>";
  $fw['fw8']="<strong><font color=#FF9933>⑧号</font></strong>";
  //服务器变量
  //SID更新变量
  $sidma=$qqlist['newsid'];
  $sid['yesno']="暂时未知";
  $sid['yes']="<font color=#0DC70D>自动更新</font>";
  $sid['no']="<font color=red>不能更新</font>";
  //SID更新变量
  echo '<tr>
         <td> <input type="checkbox" name="qid[]" value="'.$qqlist['qid'].'"></td>
         <td>'.$fw["$fwq"].'</td>
         <td><img border="0" src="http://wpa.qq.com/pa?p=2:'.$qqlist['qq'].':46" title="这是您QQ状态"></td>
         <td>'.$qqlist['qq'].'</td>
		 <td><a href="../change.php?qid='.$qqlist['qid'].'">更换服务器</a></td>
      </tr>
';
  }
?>                    
											
                                        </tbody>
                                    </table>                     
								</div> 
                        </div>
                    </div>
                </div>  
            </div>
            
        
        
    
    <div class="dialog" id="source" style="display: none;" title="Source"></div>  
	</form>
    </div>
<script type="text/javascript">
function open13()
{
	var diag = new Dialog();
	diag.Title = "添加QQ记录";
	diag.Width = 275;
	diag.Height = 155;
	diag.URL = "../qplus.php";
	diag.show();
}
function funCheck(){
var chk=document.getElementsByName('qid[]');
if(document.getElementsByName('checkName')[0].checked){
for(var i=0;i<chk.length;i++){
chk[i].checked=true;
}
}else{
for(var i=0;i<chk.length;i++){
chk[i].checked=false;
}
}
}
</script>
</body>
</html>
<?php
//如果登录结束
			}
			else
			{
			//如果没登录就显示下面的
            header("refresh:0;url=tishi.php");
			}
?>